#include "Testset.h"

class IITDTestset : public Testset
{
private:
    /* data */
protected:
    virtual int get_person_id(string filename) const
    {
        return atoi(filename.substr(0, 3).c_str());
    }

public:
    using Testset::Testset;
    // IITDTestset(string dir) : Testset(dir){};
    ~IITDTestset(){};
    virtual void load()
    {
        string filename;
        dirent *file;
        DIR *m_dir = opendir(dir.c_str());

        while ((file = readdir(m_dir)) != NULL)
        {
            if (strcmp(file->d_name, ".") == 0 ||
                strcmp(file->d_name, "..") == 0)
                continue;
            filename = file->d_name;
            int person_id = this->get_person_id(filename);
            cv::Mat img = cv::imread(dir + "/" + filename, 0);
            datas.push_back(palmprint(person_id, filename, img));
        }
    };
};
